<ol class="breadcrumb">
    <li> <i class="fa fa-anchor"></i>
        &nbsp;服务商管理
    </li>
    <li>编辑服务城市</li>
</ol>

<div class="col-xs-12 info-center" >
    <div class="bs-callout bs-callout-warning">
        <h4>
            系统使用单位: <strong>{:C('COLLEGE_NAME')}</strong>
        </h4>
    </div>
</div>

<div class="col-xs-12 info-center">
    <div class="panel panel-mcit">
        <div class="panel-heading">
            <i class="fa fa-list"></i>
            &nbsp;&nbsp;编辑服务商分布城市信息
        </div>
        <div class="panel-body">
            <div class="alert alert-warning">
                <p><i class="fa fa-paperclip"></i>&nbsp;编辑服务商分布城市信息【<i class="fa fa-asterisk required-fa"></i>号为必填项】</p>
            </div>
            <form class="mcit-dataform" id="data_form" method="post" action={:U("Services/editcity")}>
                <div class="panel-footer">
                    <div class="panel-mcit">
                        <input type="hidden" name="id" value="{$cityOne.id}"/>
                        <div class="col-xs-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-asterisk required-fa"></i>&nbsp;服务商</span>
                                <select id="oper_id" name="oper_id" class="form-control required">
                                    <volist name="services" id="vo">
                                        <option value="{$vo.id}" <if condition="$cityOne['oper_id'] eq $vo['id']">selected = "selected"</if>>{$vo.oper_name}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="clearfix" ></div>

                        <div class="col-xs-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-asterisk required-fa"></i>&nbsp;使用方式</span>
                                &nbsp;
                                <input type="checkbox"  name="oper_pay_way1" class="" value="1" checked>&nbsp;APP
                                &nbsp;
                                <input type="checkbox"  name="oper_pay_way2" class="" value="2">&nbsp;刷卡
                                &nbsp;
                                <input type="checkbox"  name="oper_pay_way3" class="" value="3">&nbsp;现金
                                &nbsp;
                                <input type="checkbox"  name="oper_pay_way4" class="" value="4">&nbsp;其他
                            </div>
                        </div>
                        <div class="clearfix" ></div>

                        <div class="col-xs-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-asterisk required-fa"></i>&nbsp;所属地区</span>
                                <select id="location-f" name="oper_provinces" class="form-control" style="width:205px;">
                                    <option value="0">--</option>
                                    <volist name="china" id="vo">
                                        <option value="{$vo.name}">{$vo.name}</option>
                                    </volist>
                                </select>

                                <select id="location-s" name="oper_city" class="form-control required" style="width:205px;border-left:0">
                                    <option value="0">--</option>
                                    <volist name="china" id="vo">
                                        <volist name="vo['area']" id="vovo">
                                            <option value="{$vovo.name}" class="{$vo.name}" >{$vovo.name}</option>
                                        </volist>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="clearfix" ></div>

                        <div class="col-xs-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-asterisk required-fa"></i>&nbsp;办卡地址</span>
                                <input type="text" id="content"  name="content" value="{$cityOne.content}" class="form-control required" placeholder="办卡地址">
                            </div>
                        </div>
                        <div class="clearfix" ></div>

                        <div class="col-xs-6">
                            <div class="input-group">
                                <span class="input-group-addon"><i class="fa fa-asterisk required-fa"></i>&nbsp;服务电话</span>
                                <input type="text" id="oper_tel"  name="oper_tel" value="{$cityOne.oper_tel}" maxlength="11" class="form-control required" placeholder="服务电话">
                            </div>
                        </div>
                        <div class="clearfix" ></div>

                        <div class="col-xs-6">
                            <button type="submit" class="btn btn-warning"><i class="fa fa-upload"></i>&nbsp;添加</button>
                            <a href="javascript:history.go(-1);" class="btn btn-warning"><i class="fa fa-mail-reply"></i>&nbsp;返回</a>
                        </div>
                        <div class="clearfix"></div>

                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<import file="js.jquery#chained" />
<import file="js.maskedinput" />
<script>
    $(document).ready(function () {
        $("#location-s").chained("#location-f");
    });
    $("#data_form").ajaxForm({
        dataType:'json',
        clearForm:true,
        beforeSubmit:function(){
            if($("#content").val()=='' || $("#oper_tel").val()==''){
                alertify.error("请认真填写，数据不能为空！");
                return false;
            }
            return true
        },
        success:function(data){
            if(data.state==100){
                alertify.success(data.msg);
                location.href = data.url;
            }else{
                alertify.error(data.msg);
            }
        }
    });
</script>